package com.youhong.teethcare.utils

import com.youhong.teethcare.R
import com.youhong.teethcare.javabeans.BrushingRecord
import kotlinx.android.synthetic.main.activity_brush_area_show.*

class BrushShowUtils {
    object HistoryBrushAreaUtils{
        fun getArea(record: BrushingRecord) :ArrayList<Int>{
            var area1 = record.area1;
            var area2 = record.area2;
            var area3 = record.area3;
            var area4 = record.area4;
            var area5 = record.area5;
            var area6 = record.area6;
            var cleanList = ArrayList<Int>();
            initArea1(area1,cleanList)
            initArea2(area2,cleanList)
            initArea3(area3,cleanList)
            initArea4(area4,cleanList)
            initArea5(area5,cleanList)
            initArea6(area6,cleanList)
            return cleanList;
        }
        fun initArea1(area1:Int,cleanList:ArrayList<Int>){
            when(area1){
                1->{
                    cleanList.add(R.drawable.brush_history_bottom_bottom)
                }
                4->{cleanList.add(R.drawable.brush_history_bottom_top)}
                5->{
                    cleanList.add(R.drawable.brush_history_bottom_top)
                    cleanList.add(R.drawable.brush_history_bottom_bottom)
                }
            }
        }
        fun initArea2(area1:Int,cleanList:ArrayList<Int>){
            when(area1){
                1->{
                    cleanList.add(R.drawable.brush_history_top_top)
                }
                4->{cleanList.add(R.drawable.brush_history_top_bottom)}
                5->{
                    cleanList.add(R.drawable.brush_history_top_top)
                    cleanList.add(R.drawable.brush_history_top_bottom)
                }
            }
        }
        fun initArea3(area1:Int,cleanList:ArrayList<Int>){
            when(area1){

                1->{
                    cleanList.add(R.drawable.brush_history_leftbottom_left)
                }
                2->{
                    cleanList.add(R.drawable.brush_history_leftbottom_middle)
                }
                3->{
                    cleanList.add(R.drawable.brush_history_leftbottom_left)
                    cleanList.add(R.drawable.brush_history_leftbottom_middle)
                }

                4->{  cleanList.add(R.drawable.brush_history_leftbottom_right)}
                5->{
                    cleanList.add(R.drawable.brush_history_leftbottom_left)
                    cleanList.add(R.drawable.brush_history_leftbottom_right)
                }
                6->{
                    cleanList.add(R.drawable.brush_history_leftbottom_middle)
                    cleanList.add(R.drawable.brush_history_leftbottom_right)
                }
                7->{
                    cleanList.add(R.drawable.brush_history_leftbottom_left)
                    cleanList.add(R.drawable.brush_history_leftbottom_middle)
                    cleanList.add(R.drawable.brush_history_leftbottom_right)
                }
            }
        }
        fun initArea4(area1:Int,cleanList:ArrayList<Int>){
            when(area1){

                1->{
                    cleanList.add(R.drawable.brush_history_lefttop_left)
                }
                2->{
                    cleanList.add(R.drawable.brush_history_lefttop_middle)
                }
                3->{
                    cleanList.add(R.drawable.brush_history_lefttop_left)
                    cleanList.add(R.drawable.brush_history_lefttop_middle)
                }

                4->{  cleanList.add(R.drawable.brush_history_lefttop_right)}
                5->{
                    cleanList.add(R.drawable.brush_history_lefttop_left)
                    cleanList.add(R.drawable.brush_history_lefttop_right)
                }
                6->{
                    cleanList.add(R.drawable.brush_history_lefttop_middle)
                    cleanList.add(R.drawable.brush_history_lefttop_right)
                }
                7->{
                    cleanList.add(R.drawable.brush_history_lefttop_left)
                    cleanList.add(R.drawable.brush_history_lefttop_middle)
                    cleanList.add(R.drawable.brush_history_lefttop_right)
                }
            }
        }
        fun initArea5(area1:Int,cleanList:ArrayList<Int>){
            when(area1){
                1->{
                    cleanList.add(R.drawable.brush_history_rightbottom_right)
                }
                2->{
                    cleanList.add(R.drawable.brush_history_rightbottom_middle)
                }
                3->{
                    cleanList.add(R.drawable.brush_history_rightbottom_right)
                    cleanList.add(R.drawable.brush_history_rightbottom_middle)
                }

                4->{  cleanList.add(R.drawable.brush_history_rightbottom_left)}
                5->{
                    cleanList.add(R.drawable.brush_history_rightbottom_right)
                    cleanList.add(R.drawable.brush_history_rightbottom_left)
                }
                6->{
                    cleanList.add(R.drawable.brush_history_rightbottom_left)
                    cleanList.add(R.drawable.brush_history_rightbottom_middle)
                }
                7->{
                    cleanList.add(R.drawable.brush_history_rightbottom_left)
                    cleanList.add(R.drawable.brush_history_rightbottom_middle)
                    cleanList.add(R.drawable.brush_history_rightbottom_right)
                }
            }
        }
        fun initArea6(area1:Int,cleanList:ArrayList<Int>){
            when(area1){
                1->{
                    cleanList.add(R.drawable.brush_history_righttop_right)
                }
                2->{
                    cleanList.add(R.drawable.brush_history_righttop_middle)
                }
                3->{
                    cleanList.add(R.drawable.brush_history_righttop_right)
                    cleanList.add(R.drawable.brush_history_righttop_middle)
                }
                4->{  cleanList.add(R.drawable.brush_history_righttop_left)}
                5->{
                    cleanList.add(R.drawable.brush_history_righttop_right)
                    cleanList.add(R.drawable.brush_history_righttop_left)
                }
                6->{
                    cleanList.add(R.drawable.brush_history_righttop_left)
                    cleanList.add(R.drawable.brush_history_righttop_middle)
                }
                7->{
                    cleanList.add(R.drawable.brush_history_righttop_right)
                    cleanList.add(R.drawable.brush_history_righttop_middle)
                    cleanList.add(R.drawable.brush_history_righttop_left)
                }
            }
        }
    }


}